#!/bin/bash
if [ -n "$1" ];then
    {
        if [ -n "$2" ];then
        {
            export access_token="$(cat $Gitee_Repo/etc/access_token)"
            export name=$1
            export org=$2
            export description=$3
            curl -X POST --header "Content-Type: application/json;charset=UTF-8" "https://gitee.com/api/v5/users/organization" -d "{"access_token":"${access_token}","name":"${name}","org":"${org}","description":"${description}"}"
	        printf "\n"
            read -p "请输入返回代码:" request
	        if (($request > 199 && $request < 300));then
            {
                echo "创建成功！"
            }
            else
            {
                echo "创建失败，若要帮助请联系3591695778@qq.com"
            }
            fi
            exit
        }
        fi
    }
fi
        echo "使用方法: 新组织名 地址(https://gitee.com/后面的) 介绍(选填)"
        exit